home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Special 25
/
AMIGAplus Sonderheft 25 (2000)(Falke)(DE)(Track 1 of 4)[!].iso
/
Updates
/
PowerPC
/
jpeg2ps
/
jpeg2ps.txt
< prev
next >
Wrap
Text File
|
2000-05-16
|
15KB
|
339 lines
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
jpeg2ps - convert JPEG compressed images to PostScript Level 2
jpeg2ps is available from http://www.ifconnection.de/~tm
and many other sites, notably CTAN mirrors.
Copyright (C) 1994-99 Thomas Merz (tm@muc.de)
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Purpose of jpeg2ps
==================
jpeg2ps converts JPEG files to PostScript Level 2 or 3 EPS. In fact, jpeg2ps
is not really a converter but a "wrapper": it reads the image parameters
(width, height, number of color components) in a JPEG file, writes the
according EPS header and then copies the compressed JPEG data to the output
file. Decompression is done by the PostScript interpreter (only PostScript
Level 2 and 3 interpreters support JPEG compression and decompression).
If you have a slow communication channel and a fast printer, sending
compressed image data is a big win.
Change History
==============
V1.8 (July 28, 1999)
- Added -q option for suppressing all non-error messages.
- Don't use the supplied getopt on Unix by default, but still
include the source module in the distribution (and use it on
DOS/Windows)
- Added -p option for setting the page size on the command line.
If no such option is supplied, A4 or letter is used as default,
according to a compile time option.
- Renamed makefile.gcc to the more common Makefile.
- Added casts to get rid of some warning messages.
- Added Mac support for use with DropUNIX. This required opening
the files in binary mode, properly initializing some statics,
and replacing the getopt loop with a plain argc loop (for now).
V1.7 (April 9, 1999)
- Fixed an omission in the Makefile (makefile.gcc)
- Removed the OS2 #ifdefs and made the conditional code identical to the
DOS code. Therefore, using -DDOS should also work on OS/2.
V1.6 (March 29, 1999)
- Changed all references to my old Web site to the current address
http://www.ifconnection.de/~tm
- Added support for OS/2, provided by
Stefan A. Deutscher (sad@utk.edu / stefand@ibm.net)
- Added support for VMS, provided by
Rolf Niepraschk (niepraschk@ptb.de)
- Changed the get_2bytes() macro in readjpeg.c to a static function
in order to avoid portability issues. Since the evaluation order
in the formely used macro version isn't guaranteed, the result
was garbled on some platforms, notably with the Metrowerks C
compilers for BeOS and Macintosh.
- Changed the auto rotate feature in order to produce "clean" (unrotated)
EPS files. The old feature of automatically rotating images to
landscape mode if width > height can be reactivated with the new
command line option "-a" (auto rotate)
- Changed the ASCII85 output routine in order to avoid two consecutive
percent characters at the beginning of a line. Although legal PostScript,
this may cause trouble with some post-processing programs, notably
when including jpeg2ps output in TeX files. This should fix the
problems dvips users sometimes encountered when using jpeg2ps.
The comment in this file (jpeg2ps.txt) regarding problems with
TeX PostScript drivers has been deleted.
V1.5 (Dec. 12, 1996)
- Included ASCIIHex encoding again (the code was already there,
only command line option added). This is primarily useful as as
workaround for a brain-damaged dvips "feature" (see below).
- Added note on dvips and tgif in jpeg2ps.txt.
- Removed jpeg2pdf again. Its functionality will be contained in the
forthcoming PDFlib C library and some library client programs.
V1.4 (Aug. 19, 1996)
- included getopt.c in distribution, changed option handling
- prepared readjpeg.c for use with jpeg2pdf program (accept baseline only)
- included jpeg2pdf in the distribution
V1.3 (Jan. 31, 1996)
- Fixed ASCII85 encoding bug. In rare cases ~ and > could get
separated.
V1.2 (Jan. 25, 1996)
- Fixed "unsigned" bug when reading JFIF density marker.
V1.1 (Jan. 22, 1996) Several enhancements:
- invert colors of Adobe Photoshop CMYK files
- interpret JFIF resolution ("density") markers
- implemented -r switch for specifying resolution
- accept compression markers other than SOF0 and SOF1 (this won't
be useful for many people, and didn't have any testing).
V1.0 (Jan. 9, 1996) Re-release of formerly released Usenet version.
Building JPEG2PS
================
jpeg2ps is coded in rather simple-minded ANSI C. It should compile cleanly
on many systems. For old K&R compilers, include the compiler flag -DKNR in
the makefile to disable ANSI prototypes.
The jpeg2ps distribution is available in .zip and .tar.gz format.
jpeg2ps-x.x.zip is intended for MS-DOS (real or DOS box in Windows)
and also includes an executable. Source code is identical in both
jpeg2ps-x.x.zip and jpeg2ps-x.x.tar.gz, the only exception being different
line end conventions.
General compilation options
---------------------------
-DA4 makes jpeg2ps use A4 as default paper size. If -DA4 is not
given, letter format will be used instead. Note that the paper
size can always be specified at the command line.
Unix
----
jpeg2ps should compile out of the box on most Unix systems,
probably after a little Makefile tweaking. The distributed
Makefile is set up for GCC on Linux.
DOS
---
Use -DDOS to compile jpeg2ps on DOSish systems. The distributed
source builds fine with MS Visual C++ 6.0. A project file for
this environment is included in the distribution.
OS/2
----
OS/2 support was provided by Stefan A. Deutscher (sad@utk.edu / stefand@ibm.net)
and is included in the distribution "as is", i.e., I'm unable to assist in
any OS/2-related issues. The following is from Stefan's description for OS/2:
>The executable was made from the unmodified unix sources with gcc / emx09c +
>emxfix2 applied. To run it you need the emx runtime system, which you
>find as emxrt.zip, or on ftp-os2.cdrom.com or ftp-os2.nmsu.edu or ftp.leo.org.
>Newer versions than emx09c+ef2 should be fine. I tested this only on Warp 4,
>and there it works.
Mac
---
jpeg2ps can be built on the Mac using a facility called DropUNIX. This is
a wrapper for conventional command-line driven Unix programs which gives
some sort of drag-and-drop support. However, command line options are
not available. For this reason, jpeg2ps always generates ASCII85 output
if built on the Mac.
In order to build jpeg2ps on the Mac, you will need DropUNIX from
http://www.zenspider.com or some mirror, such as
http://omlc.ogi.edu/software/tex_convert
and set the C preprocessor define -DMAC. Since the MetroWerks compiler
has a somewhat kludgey way to set preprocessor options, the file
prefix-mac.pch is supplied which should be added to the project as
a precompiled header (see MW docs).
The idea for the Mac port and the DropUNIX support were provided by
Ujwal Sathyam (setlur@bigfoot.com).
Although I successfully built jpeg2ps with the MetroWerks compiler,
Mac support is still somewhat experimental. The required build
files are not included in the distribution. (No, please don't ask me for
an executable).
Note that for unknown reason the Mac version currently supports only
conversion of single files. Although it seems to work with multiple
files too, the output generated for the second and subsequent files
will be rubbish.
VMS
---
A VMS build file was provided by Rolf Niepraschk (niepraschk@ptb.de). It isn't
supported by the author of this software. Use the supplied file "descrip.mms"
as a starting point for building jpeg2ps with the VMS build tool mms.
Usage Details
=============
jpeg2ps [options] file.jpg > file.eps
-a auto rotate feature
-b binary mode
-h hex mode (ASCIIHex encoding)
-o name output file name (as an alternative to output redirection)
-p size page size name. Known names are:
a0, a1, a2, a3, a4, a5, a6, b5, letter, legal, ledger, p11x17
-q quiet mode: suppress all informational messages
-r dpi resolution value (0 = read from file if possible)
jpeg2ps reads a JPEG file (*not* stdin) and writes a DSC-compliant EPS
file containing the compressed JPEG data in PostScript format to st